package com.mybatis.dao;

import com.lanhai.model.Station;
import com.lanhai.utils.DateUtil;

public class StationSqlProvider {
	
    public String updateTempData(Station station){
		StringBuffer sb = new StringBuffer();
		sb.append("update temp_station set lastData=" + station.getLastData());
		sb.append(",joinAgvId=" + station.getJoinAgvId());
		if(station.getLastJoinTime() != null){
			String ljt = DateUtil.getTimeDate(station.getLastJoinTime());
			sb.append(",lastJoinTime='" + ljt + "'");
		}
		sb.append(" where id=" + station.getId());
    	return sb.toString();
    }

    public String update(Station station){
		StringBuffer sb = new StringBuffer();
		sb.append("update station set state=" + station.getState());
		sb.append(" where id=" + station.getId());
    	return sb.toString();
    }
    
}
